﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UtilZ.Dotnet.Ex.Communication.Net.MQBase
{
    /// <summary>
    /// MQ订阅信息接口
    /// </summary>
    public interface IMQSubscribInfo
    {
        /// <summary>
        /// 消息输出事件
        /// </summary>
        event EventHandler<MQMessageOutputArgs> MessageOutput;

        /// <summary>
        /// 触发消息输出事件
        /// </summary>
        /// <param name="mqMessage">消息</param>
        void OnRaiseMessageOutput(IMQMessage mqMessage);

        /// <summary>
        /// 签收模式
        /// </summary>
        MQSignMode SignMode { get; }

        /// <summary>
        /// 分发模式[true:主题;false:队列]
        /// </summary>
        bool DispatchMode { get; }

        /// <summary>
        /// 主题
        /// </summary>
        string Topic { get; }

        /// <summary>
        /// 订阅标识,非空为持久化订阅,为空则为非持久化订阅
        /// </summary>
        string ID { get; }

        /// <summary>
        /// 消息选择器字符串
        /// </summary>
        string Selector { get; }

        /// <summary>
        /// Tag
        /// </summary>
        object Tag { get; set; }
    }
}
